package com.fh.common.distributedlock.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.fh.common.distributedlock.JedisPoolUtil;
import redis.clients.jedis.JedisPoolConfig;



/**
 * @author qiujunda
 * @date 2019年2月14日
 * @description
 */
//@Configuration
public class JedisPoolUtilConfig {

	
//	@Value("${spring.redis.host}") 
	private String hostName;
//	@Value("${spring.redis.port}") 
	private int port;
//	@Value("${spring.redis.lettuce.pool.max-idle}") 
	private int maxIdle;
//	@Value("${spring.redis.lettuce.pool.min-idle}") 
	private int minIdle;
//    @Value("${spring.redis.lettuce.pool.max-active}") 
    private int maxTotal;
//    @Value("${spring.redis.database}")
    private int index;
    
//    @Bean
	public JedisPoolUtil createJedisPoolUtil() {
		JedisPoolUtil jedisPoolUtil=new JedisPoolUtil(hostName,port,index,
				maxTotal,maxIdle,minIdle);
		JedisPoolConfig poolConfig = new JedisPoolConfig();
		return jedisPoolUtil;
	}
	
}
